// https : // iai.sh.cn/submission/1349131
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 1e5 + 5;

long long wealth[MAXN], lazy[MAXN];

set<pair<long long, int>> s;

void update(int i, long long val) {
  s.erase({wealth[i] + lazy[i], i});
  wealth[i] = val - lazy[i];
  s.insert({wealth[i] + lazy[i], i});
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  cin >> n;
  cin >> m;
  for (int i = 0; i < n; i++) {
    cin >> wealth[i];
    s.insert({wealth[i], i});
  }

  while (m--) {
    char type;
    cin >> type;

    if (type == 'i') {
      int u, t;
      cin >> u >> t;
      update(u - 1, t);
    } else {
      long long standard;
      cin >> standard;

      while (!s.empty() && s.begin()->first < standard) {
        int i = s.begin()->second;
        s.erase(s.begin());
        lazy[i] += standard - (wealth[i] + lazy[i]);
        s.insert({standard, i});
      }
    }
  }

  for (int i = 0; i < n; i++) {
    cout << wealth[i] + lazy[i] << endl;
  }

  return 0;
}
